//index.js
//获取应用实例
const app = getApp()
const {formatTime}  = require('../../utils/util')
const http = require('../../utils/http');

Page({
  data: {
    count:1,
    motto: 'Hello World',
    userInfo: {},
    hasUserInfo: true,
    datalist:[1,2,3,4,5]

  },
  onReady(){
// console.log(formatTime(new Date()))
// console.log(http);
console.log(wx.env)
  },
  changemsg(){
    this.setData({
      motto:'gp16'
    })
  },
  tapName(arg){
console.log(arg.currentTarget.dataset.hi)
  },
  handleTap1(){
    console.log('handleTap1')
  }
,
  handleTap2(){
    console.log('handleTap2')
  }
,
  handleTap3(){
    console.log('handleTap3')
  },

  increment(event){
console.log(event)
    this.setData({
      count:this.data.count + parseInt(event.currentTarget.dataset.num)
      })
  }

  ,decrement(event){
    this.setData({
      count:this.data.count - parseInt(event.currentTarget.dataset.num)
    })
  }

  ,
  gotodolist(){
    // wx.navigateTo({
    //   url: '/pages/todolist/todolist',
    // })
    wx.redirectTo({
      url: '/pages/todolist/todolist'
    })
  },
  golog(){
    wx.switchTab({
      url: '/pages/logs/logs',
    })
  }

})
